import { reqCategoryList, reqGetBannerList, reqGetFloorList } from "@/api";
// import {reqBannerList} from '@/api/'
const state = {
    categoryList: [
        { b: 6666 }
    ],
    bannerList: [],
    floorlist: []
};
const mutations = {
    CATEGORYLIST(state, categoryList) {
        // console.log(state,categoryList);
        // state.categoryList = categoryList
        state.categoryList = categoryList

    },
    BANNERLIST(state, bannerlists) {
        state.bannerList = bannerlists
    },
    FLOORLIST(state,floorlist) {
        state.floorlist = floorlist
    }
};
const actions = {
    async categoryList({ commit }) {

        let result = await reqCategoryList();
        if (result.code == 200) {
            commit("CATEGORYLIST", result.data)
        }
    },

    async getBannerlist({ commit }) {

        let result = await reqGetBannerList();
        // console.log('我是actions', result);
        if (result.code == 200) {
            console.log('打印banner');
            commit("BANNERLIST", result.data)

        }
    },
    async getFloorlist({ commit }) {
        let result = await reqGetFloorList();
        if(result.code == 200) {
            console.log('打印floor');
            commit("FLOORLIST",result.data)
        }
    }
};
const getters = {};
export default {
    state,
    mutations,
    actions,
    getters
}